import { DataTableInst } from 'naive-ui'
export { ProTableQueryItem, ProTableQuery } from './ProTableQuery'
export { ProTableColumn, ProTableColumns } from './ProTableColumn'

export type ProTableRequest = (
  pages?: any,
  query?: any
) => {
  data?: any[]
  total?: number
  preCount?: number
  nextCount?: number
  error?: any
}

export type ProTableInst = {
  // 数据重新加载
  reload: () => void
  // 数据静默加载
  staticReload: () => void
  // 搜索
  search: (params?: Record<string, any>) => void
  // 搜索重置
  reset: () => void
  // 设置页码
  setPageIndex: (index: number) => void
  // 设置页大小
  setPageSize: (size: number) => void
  // 导出方法
  excelExportDownload: () => void
} & DataTableInst
